package stream;

import java.util.Arrays;
import java.util.List;

/**
 * 统计流中元素的个数
 */
public class StreamCount {
    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 3, 4);
        long count = list.stream().count();
        System.out.println("count = " + count);
    }
}
